<template>
    <div class="List_content">
        <div class="flex aic list_content_btn" v-if="props.type == 0">
            <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                    <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                        <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                        <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>
                    </el-dropdown-menu>
                </template>
            </el-dropdown>
            <el-button type="danger" @click="refuseClick">初筛未通过</el-button>
            <el-button type="success" @click="passClick">初筛通过</el-button>
            <el-button type="primary" @click="noPassClick">未通过通知短信</el-button>
            <!-- <el-dropdown trigger="click" style="margin-left: 16px;">
                <span class="el-dropdown-link">
                    <el-button type="danger">回退流程</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="backClick(1)">初筛</el-dropdown-item>
                    </el-dropdown-menu>
                </template>
            </el-dropdown> -->
            <!-- <el-button type="primary" @click="FeedbackClick(0)">添加反馈</el-button> -->
        </div>
        <div class="flex aic list_content_btn" v-if="props.type == 1">
            <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                    <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                        <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                        <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>

                    </el-dropdown-menu>
                </template>
            </el-dropdown>
            <el-button type="danger" @click="refuseClick">应聘部门未通过</el-button>
            <el-button type="success" @click="passClick">应聘部门通过</el-button>
            <el-button type="primary" @click="noPassClick">未通过通知短信</el-button>
            <!-- <el-button type="primary" @click="sendClicks">发送简历给面试官</el-button> -->
            <el-dropdown trigger="click" style="margin-left: 16px;">
                <span class="el-dropdown-link">
                    <el-button type="danger">回退流程</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 120px;">
                        <el-dropdown-item @click="backClick(1)">初筛</el-dropdown-item>
                        <!-- <el-dropdown-item @click="backClick(2)">应聘部门筛选</el-dropdown-item> -->
                        <!-- <el-dropdown-item @click="backClick(3)">笔试</el-dropdown-item>
                        <el-dropdown-item @click="backClick(4)">面试</el-dropdown-item>
                        <el-dropdown-item @click="backClick(5)">体检审查</el-dropdown-item> -->
                    </el-dropdown-menu>
                </template>
            </el-dropdown>

            <!-- <el-button type="primary" @click="FeedbackClick(0)">添加反馈</el-button> -->

        </div>
        <div class="flex aic list_content_btn" v-if="props.type == 2">
            <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                    <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                        <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                        <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>

                    </el-dropdown-menu>
                </template>
            </el-dropdown>
            <el-button type="primary" @click="qianClick">笔试签到表</el-button>
            <el-button type="danger" @click="refuseClick">笔试未通过</el-button>
            <el-button type="primary" @click="noPassClick">未通过通知短信</el-button>
            <!-- <el-button type="primary" @click="sendClicks">发送简历给面试官</el-button> -->
            <el-button type="success" @click="passClick">笔试通过</el-button>
            <el-button type="primary" @click="PenFileClick">导入笔试成绩</el-button>
            <el-button type="primary" @click="PenClick">发送笔试通知</el-button>
            <el-dropdown trigger="click" style="margin-left: 16px;">
                <span class="el-dropdown-link">
                    <el-button type="danger">回退流程</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 120px;">
                        <el-dropdown-item @click="backClick(1)">初筛</el-dropdown-item>
                        <el-dropdown-item @click="backClick(2)">应聘部门筛选</el-dropdown-item>
                        <!-- <el-dropdown-item @click="backClick(3)">笔试</el-dropdown-item> -->
                        <!-- <el-dropdown-item @click="backClick(4)">面试</el-dropdown-item> -->
                        <!-- <el-dropdown-item @click="backClick(5)">体检审查</el-dropdown-item> -->
                    </el-dropdown-menu>
                </template>
            </el-dropdown>

            <!-- <el-button type="primary" @click="FeedbackClick(0)">添加反馈</el-button> -->

        </div>
        <div class="flex aic list_content_btn" v-if="props.type == 3">
            <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                    <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                        <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                        <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>

                    </el-dropdown-menu>
                </template>
            </el-dropdown>
            <el-button type="primary" @click="qianClick">面试签到表</el-button>
            <el-button type="primary" @click="FaceFileClick">导入面试成绩</el-button>

            <!-- <el-button type="primary" @click="sendClicks">发送简历给面试官</el-button> -->
            <el-button type="danger" @click="refuseClick">面试未通过</el-button>
            <el-button type="primary" @click="noPassClick">未通过通知短信</el-button>

            <el-button type="success" @click="passClick">面试通过</el-button>
            <el-button type="primary" @click="faceClick">邀约面试</el-button>

            <el-dropdown trigger="click" style="margin-left: 16px;">
                <span class="el-dropdown-link">
                    <el-button type="danger">回退流程</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 120px;">
                        <el-dropdown-item @click="backClick(1)">初筛</el-dropdown-item>
                        <el-dropdown-item @click="backClick(2)">应聘部门筛选</el-dropdown-item>
                        <el-dropdown-item @click="backClick(3)">笔试</el-dropdown-item>
                        <!-- <el-dropdown-item @click="backClick(4)">面试</el-dropdown-item> -->
                        <!-- <el-dropdown-item @click="backClick(5)">体检审查</el-dropdown-item> -->
                    </el-dropdown-menu>
                </template>
            </el-dropdown>

            <!-- <el-button type="primary" @click="FeedbackClick(0)">添加反馈</el-button> -->

        </div>
        <div class="flex aic list_content_btn" v-if="props.type == 4">
            <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                    <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                        <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                        <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>

                    </el-dropdown-menu>
                </template>
            </el-dropdown>
            <!-- <el-button type="primary" @click="EmploymentClick(0)">录用通知</el-button> -->
            <!-- <el-button type="primary" @click="PublicityClick">录用公示</el-button> -->
            <el-button type="primary" @click="GsClick">公示通知</el-button>
            <el-button type="primary" @click="CheckupClick">体检通知</el-button>
            <!-- <el-button type="danger" @click="backClick">回退流程</el-button> -->
            <el-dropdown trigger="click" style="margin-left: 16px;">
                <span class="el-dropdown-link">
                    <el-button type="danger">回退流程</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 120px;">
                        <el-dropdown-item @click="backClick(1)">初筛</el-dropdown-item>
                        <el-dropdown-item @click="backClick(2)">应聘部门筛选</el-dropdown-item>
                        <el-dropdown-item @click="backClick(3)">笔试</el-dropdown-item>
                        <el-dropdown-item @click="backClick(4)">面试</el-dropdown-item>
                        <!-- <el-dropdown-item @click="backClick(5)">体检审查</el-dropdown-item> -->
                    </el-dropdown-menu>
                </template>
            </el-dropdown>

            <!-- <el-button type="primary" @click="FeedbackClick(0)">添加反馈</el-button> -->

        </div>
        <div class="flex aic list_content_btn" v-if="props.type == 5">
            <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                    <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 86px;">
                        <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                        <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                        <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>
                    </el-dropdown-menu>
                </template>
            </el-dropdown>

            <!-- <el-button type="primary">批量下载简历</el-button>
            
            <el-button type="danger" @click="FeedbackClick(1)">放弃入职</el-button>
            <el-button type="primary" @click="EmploymentClick(1)">发送入职通知</el-button>
            <el-button type="primary" @click="ruzhi">确定入职</el-button> -->
            <el-button type="primary" @click="EmploymentClick(1)">发送入职通知</el-button>
            <el-button type="primary" @click="PublicityClick">录用公示</el-button>
            <el-dropdown trigger="click" style="margin-left: 16px;margin-right: 16px;">
                <span class="el-dropdown-link">
                    <el-button type="danger">回退流程</el-button>
                </span>
                <template #dropdown>
                    <el-dropdown-menu style="width: 120px;">
                        <el-dropdown-item @click="backClick(1)">初筛</el-dropdown-item>
                        <el-dropdown-item @click="backClick(2)">应聘部门筛选</el-dropdown-item>
                        <el-dropdown-item @click="backClick(3)">笔试</el-dropdown-item>
                        <el-dropdown-item @click="backClick(4)">面试</el-dropdown-item>
                        <el-dropdown-item @click="backClick(5)">体检审查</el-dropdown-item>
                        <!-- <el-dropdown-item @click="backClick(8)">待入职</el-dropdown-item> -->
                    </el-dropdown-menu>
                </template>
            </el-dropdown>
            <el-button type="primary" @click="noPassClick">未通过通知短信</el-button>
            <!-- <el-button type="primary" @click="FeedbackClick(0)">添加反馈</el-button> -->
        </div>
        <div class="flex jcfe aic" v-if="props.type == 6">
            <div class="flex aic margin-left16">
                <p class="fonts16 flex aic"><span style="color:red;">*</span> 投递职位：</p>
                <el-select v-model="state.positionId" clearable placeholder="请选择投递职位" style="width: 180px">
                    <el-option v-for="item in state.positionOptions" :key="item.id" :label="item.positionName"
                        :value="item.id" />
                </el-select>
            </div>
            <!-- <div class="list_content_header flex fonts14 jcc aic"
                :class="state.navValue == item.id ? 'list_content_headers' : ''" v-for="(item, index) in state.navData"
                :key="index" @click="navClick(item)">
                {{ item.label }}
            </div> -->
        </div>
        <div class="flex jcsb aic" v-if="props.type == 7">
            <div class="flex aic list_content_btn">
                <el-dropdown trigger="click">
                    <span class="el-dropdown-link">
                        <el-button type="primary" style="margin-right: 16px;">批量下载简历</el-button>
                    </span>
                    <template #dropdown>
                        <el-dropdown-menu style="width: 86px;">
                            <el-dropdown-item @click="down('word')">Word</el-dropdown-item>
                            <el-dropdown-item @click="down('excel')">Excel</el-dropdown-item>
                            <el-dropdown-item @click="down('pdf')">PDF</el-dropdown-item>

                        </el-dropdown-menu>
                    </template>
                </el-dropdown>
                <el-button type="danger" @click="deteleTalentClick">删除简历</el-button>
                <el-button type="primary" @click="refashClick">重新进入筛选</el-button>
                <el-button type="primary" @click="blickClick(0)">添加白名单</el-button>
                <el-button type="danger" @click="blickClick(1)">添加黑名单</el-button>

            </div>
            <!-- <div class="flex jcfe aic">
                <div class="list_content_header flex fonts14 jcc aic"
                    :class="state.navValue == item.id ? 'list_content_headers' : ''" v-for="(item, index) in state.navData"
                    :key="index" @click="navClick(item)">
                    {{ item.label }}
                </div>
            </div> -->
        </div>
        <div class="jcsb flex aic" v-if="props.type != 6">
            <!-- <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox> -->
            <p class="fonts14 colors" v-if="props.type == 6">默认按匹配度由高到低排序</p>
        </div>
        <ul class="list_content_ul" v-if="state.list.length != 0 && props.type == 6">
            <li v-for="(item, index) in state.list" :key="index" class="list_content_li flex jcsb aic">
                <!-- <div v-if="props.type != 7 && props.type != 6" :class="item.state == 0 ? 'list_content_li_gary' : ''"
                    class="list_content_li_state">
                    <span>{{ item.state == 0 ? '已读' : '未读' }}</span>
                </div> -->
                <div v-if="props.type == 7 && item.state == 0" class="list_content_li_states">
                    <span>黑名单</span>
                </div>
                <div class="flex aic list_content_li_left">
                    <el-checkbox v-if="props.type != 6" v-model="item.checked" />
                    <div class="list_content_li_main" @click="goDetail(item)">
                        <div class="flex aie">
                            <p class="fonts18 fontw500">{{ item.personalInformation.fullName }}</p>
                            <p class="fonts16" style="margin-left: 30px;color: #FE6470;">
                                {{ dictFuns(item.personalInformation.lookingForwardSalary, "salary") }}
                            </p>
                            <div class="flex aic" style="margin-left: 30px;" v-if="props.type != 6">
                                <el-progress :percentage="item.percentage" :show-text="false" style="width: 120px;" />
                                <p class="fonts16" style="margin-left: 30px;color: #2F6CBC;">智能匹配度 {{ item.percentage
                                    }}%
                                </p>
                            </div>
                        </div>
                        <div class="flex aie" style="margin-top: 16px;">
                            <div class="flex aie">
                                <!-- <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" /> -->
                                <!-- <span class="fonts14 colors" v-if="props.type != 6" style="margin-left: 4px;">{{
                                    item.personalInformation.lookingForwardSalary }}</span> -->
                                <span class="fonts14 colors" v-if="props.type == 6" style="margin-left: 4px;">官网</span>
                            </div>
                            <div class="flex aie" style="margin-left: 18px;">
                                <!-- <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" /> -->
                                <span class="fonts14 colors" style="margin-left: 4px;">{{
            dictFuns(item.personalInformation.gender, "sys_user_sex")
        }}&nbsp;&nbsp;|&nbsp;&nbsp;</span>
                            </div>
                            <span class="fonts14 colors">{{ startWorkTimeFun(item.personalInformation.startWorkTime)
                                }}&nbsp;&nbsp;|&nbsp;&nbsp;</span>
                            <span class="fonts14 colors">{{ dictFuns(item.personalInformation.jobSearchStatus,
            "status_of_job_hunting")
                                }}&nbsp;&nbsp;|&nbsp;&nbsp;</span>
                            <span class="fonts14 colors">{{ dictFuns(item.personalInformation.lookingForwardIndustry,
            "company_industry") }}</span>
                        </div>
                        <div class="flex aie " style="margin-top: 16px;">
                            <div class="flex aie" style="">
                                <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" />
                                <span class="fonts14 colors" style="margin-left: 4px;">{{
            item.workExperiences[0].companyName }}</span>
                            </div>
                            <span class="fonts14 colors" style="">{{ item.workExperiences[0].positionName
                                }}</span>
                            <span class="fonts14 colors">{{
            item.workExperiences[0].experienceStartTime.slice(0, 10) + "-" +
            item.workExperiences[0].experienceEndTime.slice(0, 10)
        }}</span>
                        </div>
                        <div class="flex aie " style="margin-top: 16px;">
                            <div class="flex aie" style="">
                                <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" />
                                <span class="fonts14 colors" style="margin-left: 4px;">{{
                item.educationExperiences[item.educationExperiences.length - 1].schoolName }}</span>
                            </div>
                            <span class="fonts14 colors" style="">{{
            item.educationExperiences[item.educationExperiences.length - 1].specialFieldName
        }}</span>
                            <span class="fonts14 colors">{{
                dictFuns(item.educationExperiences[item.educationExperiences.length - 1].educationLevel,
                    "education")
            }}</span>
                        </div>
                    </div>
                </div>
                <div class="flex list_content_li_right" v-if="props.type == 6">
                    <!-- 初筛 -->
                    <el-button type="primary" v-if="item.isInvite == null || item.isInvite == 0"
                        @click="invite(item)">邀请投递</el-button>
                    <el-button type="primary" disabled v-if="item.isInvite == 1" @click="invite(item)">已邀请</el-button>
                </div>
            </li>
        </ul>
        <ul class="list_content_ul" v-if="state.list.length != 0 && props.type != 6 && false">
            <li v-for="(item, index) in state.list" :key="index" class="list_content_li flex jcsb aic">
                <!-- <div v-if="props.type != 7 && props.type != 6" :class="item.state == 0 ? 'list_content_li_gary' : ''"
                    class="list_content_li_state">
                    <span>{{ item.state == 0 ? '已读' : '未读' }}</span>
                </div> -->
                <div v-if="props.type == 7 && item.blackList == 1" class="list_content_li_states">
                    <span>黑名单</span>
                </div>
                <div class="flex aic list_content_li_left">
                    <el-checkbox v-if="props.type != 6" v-model="item.checked" />
                    <div class="list_content_li_main" @click="goDetail(item)">
                        <div class="flex aie">
                            <p class="fonts18 fontw500">{{ item.resumeVo.personalInformation.fullName }}</p>
                            <p class="fonts16" style="margin-left: 30px;color: #FE6470;">
                                {{ dictFuns(item.resumeVo.personalInformation.lookingForwardSalary, "salary") }}
                            </p>
                            <div class="flex aic" style="margin-left: 30px;" v-if="props.type != 6">
                                <el-progress :percentage="item.intelligentMatchingDegree * 100" :show-text="false"
                                    style="width: 120px;" />
                                <p class="fonts16" style="margin-left: 30px;color: #2F6CBC;">智能匹配度 {{
            item.intelligentMatchingDegree * 100 }}%
                                </p>
                            </div>
                        </div>
                        <div class="flex aie" style="margin-top: 16px;">
                            <div class="flex aie">
                                <!-- <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" /> -->
                                <span class="fonts14 colors" style="margin-left: 4px;">{{ dictFuns(item.resumeFrom,
            "resume_from") }}</span>
                            </div>
                            <div class="flex aie" style="margin-left: 18px;">
                                <!-- <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" /> -->
                                <span class="fonts14 colors" style="margin-left: 4px;">{{
            dictFuns(item.resumeVo.personalInformation.gender, "sys_user_sex")
        }}&nbsp;&nbsp;|&nbsp;&nbsp;</span>
                            </div>
                            <span class="fonts14 colors">{{
                startWorkTimeFun(item.resumeVo.personalInformation.startWorkTime)
            }}&nbsp;&nbsp;|&nbsp;&nbsp;</span>
                            <span class="fonts14 colors">{{ dictFuns(item.resumeVo.personalInformation.jobSearchStatus,
            "status_of_job_hunting")
                                }}&nbsp;&nbsp;|&nbsp;&nbsp;</span>
                            <span class="fonts14 colors">{{
            dictFuns(item.resumeVo.personalInformation.lookingForwardIndustry, "company_industry")
        }}</span>
                        </div>
                        <div class="flex aie " style="margin-top: 16px;">
                            <div class="flex aie" style="">
                                <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" />
                                <span class="fonts14 colors" style="margin-left:10px;">{{
                item.resumeVo.workExperiences[0].companyName }}</span>
                            </div>
                            <span class="fonts14 colors" style="margin: 0 60px;">{{
            item.resumeVo.workExperiences[0].positionName
        }}</span>
                            <span class="fonts14 colors">{{
                item.resumeVo.workExperiences[0].experienceStartTime.slice(0, 10) + "-" +
                item.resumeVo.workExperiences[0].experienceEndTime.slice(0, 10)
            }}</span>
                        </div>
                        <div class="flex aie " style="margin-top: 16px;">
                            <div class="flex aie" style="">
                                <img src="@/assets/imgs/gw.png" alt="" style="width: 16px;height: 16px;" />
                                <span class="fonts14 colors" style="margin-left:10px;">{{
                item.resumeVo.educationExperiences[item.resumeVo.educationExperiences.length -
                    1].schoolName }}</span>
                            </div>
                            <span class="fonts14 colors" style="margin: 0 60px;">{{
            item.resumeVo.educationExperiences[item.resumeVo.educationExperiences.length -
                1].specialFieldName }}</span>
                            <span class="fonts14 colors">{{
            dictFuns(item.resumeVo.educationExperiences[item.resumeVo.educationExperiences.length -
                1].educationLevel, "education")
        }}</span>
                        </div>
                    </div>
                </div>
                <div class=" list_content_li_right" v-if="props.type == 0">
                    <p class="fonts16" v-if="!item.initialScreeningUnqualifiedLabel" style="color: green;">合格【系统】</p>
                    <p class="fonts16" v-else style="color:red;margin-top: 5px;"
                        v-for="(items, key) in arrayFun(item.initialScreeningUnqualifiedLabel)" :key="key">{{ items }}
                    </p>
                </div>
                <div class=" list_content_li_right" v-if="props.type == 2">
                    <p class="fonts16" v-if="item.writingTestingTime" style="color: green;">笔试时间:{{
            item.writingTestingTime
        }}</p>
                    <p class="fonts16" v-if="item.writingTestingResult == 1" style="color: green;">笔试通过</p>
                    <p class="fonts16" v-if="item.writingTestingResult == 0" style="color: red;">笔试未通过</p>
                    <p class="fonts16" v-if="item.writingTestingStatus == 2" style="color: green;">已接受笔试</p>
                    <p class="fonts16" v-if="item.writingTestingStatus == 1" style="color: green;">已通知笔试</p>
                    <p class="fonts16" v-if="item.writingTestingStatus == 0" style="color: red;">未通知笔试</p>
                </div>
                <div class=" list_content_li_right" v-if="props.type == 3">
                    <p class="fonts16" v-if="!item.initialScreeningUnqualifiedLabel" style="color: red;">
                        面试时间：{{ item.interviewDate || "暂无" }}</p>
                </div>
                <div class=" list_content_li_right" v-if="props.type == 4">
                    <el-button type="danger" v-if="item.status == 5" @click="refuseClickT(item)">背景调查未通过</el-button>
                    <el-button type="success" v-if="item.status == 5" @click="passClickT(item)">背景调查通过</el-button>
                    <el-button type="danger" v-if="item.status == 6" @click="refuseClickT(item)">体检未通过</el-button>
                    <el-button type="success" v-if="item.status == 6" @click="passClickT(item)">体检通过</el-button>
                    <el-button type="danger" v-if="item.status == 7" @click="refuseClickT(item)">放弃录用</el-button>
                    <el-button type="success" v-if="item.status == 7" @click="passClickT(item)">确认录用</el-button>
                    <!-- <p class="fonts16">{{ item.status == 5 ? "背景调查" : item.status == 6 ? "体检审查" : item.status == 7 ?
                        "录用通知/公示" : "" }}</p> -->
                    <p class="fonts16" v-if="item.medicalReportIds && item.status == 6">体检报告已上传</p>
                </div>
                <div class=" list_content_li_right" v-if="props.type == 5">
                    <p class="fonts16" v-if="!item.onBoardingTime" style="color: red;">
                        入职时间：{{ item.onBoardingTime || "暂无" }}</p>
                </div>
            </li>
        </ul>
        <div style="margin-top: 16px;" v-if="state.dataList.length != 0 && props.type != 6 && props.type != 6">
            <Table :columns="allSchemas.tableColumns" @refresh="refresh" :headerCellStyle="headerCellStyle"
                :rowStyle="rowStyle" :data="state.dataList" @register="tableRegister" />
            <!-- <Table v-if="!state.refush" :columns="allSchemas.tableColumns" :headerCellStyle="headerCellStyle" :rowStyle="rowStyle"
                :data="state.dataList" @register="tableRegister" /> -->
        </div>
        <el-empty description="暂无数据" v-if="state.dataList.length == 0 && props.type == 0" />
        <el-empty description="暂无数据" v-if="state.list.length == 0 && props.type != 0" />
        <div class="flex jcc aic List_content_footer" style="margin-top: 16px;">
            <el-pagination :current-page="state.ruleFrom.pageNum" :page-size="state.ruleFrom.pageSize"
                layout="total,sizes, prev, pager, next" :total="props.total" @size-change="handleSizeChange"
                @current-change="handleCurrentChange" :page-sizes="[10, 20, 50, 100,500]" />
        </div>
        <!-- 笔试通知 -->
        <PenFail :table-data="state.penFailData" ref="ref_PenFailVue" />
        <PenVue :refuseData="state.penData" ref="ref_PenVue" @pen-click="penSureClick" />
        <PenFile :refuseData="state.penData" ref="ref_PenFile" @penFile-click="penFileSureClick" />
        <!-- 未通过 -->
        <NoPassVue :refuseData="state.onPassData" ref="ref_noPassVue" @pen-click="noPassSureClick" />
        <!-- 导入面试成绩 -->
        <FaceFile :refuseData="state.FaceFileData" ref="ref_FaceFile" @faceFile-click="FaceFileSureClick" />
        <Refuse :refuseData="state.refuseData" ref="ref_refuse" @refuse-click="refuseSureClick" />
        <FaceVue :faceData="state.faceData" ref="ref_face" @face-click="faceSureClick" />
        <Feedback :FeedbackData="state.FeedbackData" ref="ref_Feedback" @Feedback-click="FeedbackSureClick" />
        <!-- 公示通知 -->
        <GsVue :CheckupData="state.GsData" ref="ref_Gs" @Checkup-click="GsSureClick" />
        <!-- 体检通知 -->
        <Checkup :CheckupData="state.CheckupData" ref="ref_Checkup" @Checkup-click="CheckupSureClick" />
        <!--  -->
        <Employment :EmploymentData="state.EmploymentData" ref="ref_Employment"
            @Employment-click="EmploymentSureClick" />
        <Publicity :PublicityData="state.PublicityData" ref="ref_Publicity" @Publicity-click="PublicitySureClick" />
        <DeteleVue ref="formChildrenRefs" :deteleData="state.deteleData" @deteleClick="deteleClick" />
        <!-- 人才库 -->
        <Refash ref="ref_refash" @refash-click="refashSureClick" />
        <!-- 发送简历给面试官 -->
        <SendResurme ref="ref_send" @send-click="sendClick" />
    </div>
</template>

<script lang="tsx" setup>
import { Table } from '@/components/Table'
import {
    sendNotice,
    registrationLogBack,
    sendResumeEmail,
    firstPass,
    firstNotPass,
    departmentPass,
    departmentNotPass,
    writtenExaminationPass,
    writtenExaminationNotPass,
    sendWrittenExaminationNotice,
    importWrittenExaminationScore,
    importInterviewExaminationScore,
    interviewPass,
    interviewNotPass,
    sendInterviewNotice,
    sendPhysicalExaminationNotice,
    companyAnnouncement,
    giveUpInterview,
    backgroundInvestigationPass,
    backgroundInvestigationNotPass,
    physicalExaminationPass,
    physicalExaminationNotPass,
    sendEmploymentNotice,
    sendEntryNotice,
    confirmEmployment,
    giveUpEmployment,
    confirmEntry,
    giveUpEntry,
    addFeedback,
    reFirstScreen,
    updateBackList,
    deleteResume,
    exportResume,
    positionRegistrations
} from "@/api/home/index"
import axios from 'axios';
import { editResumeList } from "@/api/personal/index"
import { ElButton, ElInput, ElMessage, ElMessageBox, ElSwitch, ElLoading } from 'element-plus'
import { dictFuns } from "@/utils/dictUnit"
import { positionListAll } from "@/api/recruit/index"
import { DeteleVue } from "@/components/Detele/index"
import { useTable } from '@/hooks/web/useTable'
import { FaceVue, Refuse, Feedback, GsVue, Checkup, NoPassVue, Employment, Publicity, PenVue, PenFile, PenFail, Refash, SendResurme, FaceFile } from "./index"
import { ref, reactive, watch, nextTick } from 'vue'
import { useRouter } from 'vue-router'
// import service from './service'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import config from '@/config/axios/config'
import { useStorage } from '@/hooks/web/useStorage'
import { useAppStoreWithOut } from '@/store/modules/app'
const { defaultHeaders } = config
const { getStorage } = useStorage()
const appStore = useAppStoreWithOut()

const { push } = useRouter()
const emit = defineEmits(['listVue'])
const props = defineProps({
    type: {
        type: Number,
        default: () => {
            return 0
        }
    },
    total: {
        type: Number,
        default: () => {
            return 0
        }
    },
    ruleFrom: {
        type: Object,
        default: () => {
            return {}
        }
    },
    data: {
        type: Array,
        default: () => {
            return []
        }
    }
})
// 表格头部信息
const headerCellStyle: any = {
    "background": "#F2F6FC",
    "height": "48px"
}
// 
const rowStyle: any = {
    "height": "48px"
}

// 处理状态数据
const statusFun = (item) => {
    let string = ""
    if (props.type == 0 || props.type == 1) {
        if (!item.initialScreeningUnqualifiedLabel) {
            string = "合格【系统】"
        } else {
            arrayFun(item.initialScreeningUnqualifiedLabel).forEach(element => {
                if (string) {
                    string = string + ";" + element
                } else {
                    string = element
                }
            });
        }
    } else if (props.type == 2) {
        if (item.writingTestingStatus == 2) {
            string = "已接受笔试"
        } else if (item.writingTestingStatus == 1) {
            string = "已通知笔试"
        } else if (item.writingTestingStatus == 0) {
            string = "未通知笔试"
        } else if (item.writingTestingResult == 1) {
            string = "笔试通过"
        } else if (item.writingTestingResult == 0) {
            string = "笔试未通过"
        }
    } else if (props.type == 3) {
        string = "面试"
    } else if (props.type == 4) {
        if (item.status == 5) {
            string = "背景调查"
        } else if (item.status == 6) {
            string = "体检审查"
        } else if (item.status == 7) {
            string = "录用通知/公示"
        }
    } else if (props.type == 5) {
        string = "入职"
    }
    return string
}
const state = reactive({
    refush: true,
    crudSchemas: [] as any,
    types: "" as any,
    dataList: [] as any,
    positionOptions: [] as any,
    positionId: "",
    navValue: 0,
    ruleFrom: {} as any,
    navData: [{
        id: 0,
        label: "匹配度"
    }, {
        id: 1,
        label: "更新时间"
    }],
    list: [] as any,
    checkData: [] as any,
    pagination: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
    },
    refuseData: {//未通过
        type: 0
    },
    penData: {},
    onPassData: {},
    FaceFileData: {},
    faceData: {},// 面试
    FeedbackData: {
        title: "添加反馈"
    },//反馈
    CheckupData: {},//体检
    GsData: {},//公示
    EmploymentData: {
        title: "录用通知"
    },//录用
    PublicityData: {} as any,//录用公示
    deteleData: {//删除框
        content: "该职位需求人数已满，请联系管理员增加职位需求人数！",
        title: "提示",
        sure: false,
        closeValue: false,
        knowBool: true
    },
    arrayIds_s: [] as any,//选中
    penFailData: {} as any,
    tijianData: {} as any,//体检审查不通过中间件数据
})
const { tableMethods, tableRegister } = useTable({
    fetchDataApi: async () => {
        return {}
    }
})
const { getElTableExpose, setColumn, refresh } = tableMethods
const hiddenFun=(e)=>{
    console.log("测试多选框是否有：",e);
    
    return true
}
// 表格基本信息
const crudSchemas = reactive<CrudSchema[]>([
    {
        field: 'selection',
        type: 'selection', 
    },
    {
        field: 'field',
        label: '姓名',
        fixed: "left",
        hidden: false,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.resumeVo?.personalInformation?.fullName}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'initialScreeningUnqualifiedLabel',
        label: '简历标签',
        // hidden: true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFunString(data[0].row.initialScreeningUnqualifiedLabel)}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'field',
        label: '性别',
        hidden: true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFuns(data[0].row.resumeVo.personalInformation.gender, "sys_user_sex") || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'field',
        label: '年龄',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.resumeVo?.personalInformation?.age}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'field',
        label: '工作年限',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{startWorkTimeFun(data[0].row.resumeVo.personalInformation?.startWorkTime) || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'field',
        label: '期望薪资',
        // hidden: true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFuns(data[0].row.resumeVo.personalInformation?.lookingForwardSalary, "salary") || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '最高学历',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFuns(data[0].row.resumeVo.educationExperiences.length != 0 ? data[0].row.resumeVo.educationExperiences[data[0].row.resumeVo.educationExperiences.length -
                                1].educationLevel : null, "education") || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '学校',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.resumeVo.educationExperiences.length != 0 ? data[0].row.resumeVo.educationExperiences[data[0].row.resumeVo.educationExperiences.length -
                                1].schoolName : "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '所学专业',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.resumeVo.educationExperiences.length != 0 ? data[0].row.resumeVo.educationExperiences[data[0].row.resumeVo.educationExperiences.length - 1].specialFieldName : "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '目前职位',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.resumeVo.personalInformation?.currentPosition || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '在职状态',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFuns(data[0].row.resumeVo.personalInformation?.jobSearchStatus, "status_of_job_hunting") || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '到岗时间',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFuns(data[0].row.resumeVo.personalInformation?.arrivalTime, "arrival_time") || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'isRead',
        label: '状态',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.isRead == 0 ? '未读' : '已读'}</div>
                        </>
                    )
                }
            }
        }
    },

    {
        field: 'sms_typeName',
        label: '政治面貌',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{dictFuns(data[0].row.resumeVo.personalInformation?.politicalOutlook, "political_outlook") || "无"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'sms_typeName',
        label: '简历匹配度',
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.intelligentMatchingDegree * 100 + "%"}</div>
                        </>
                    )
                }
            }
        }
    },
    // 笔试成绩
    {
        field: 'writingTestingStatus',
        label: '笔试通知',
        fixed: "right",
        hidden: true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.writingTestingStatus == 0 ? "未通知" : data[0].row.writingTestingStatus == 1 ? "已通知" : data[0].row.writingTestingStatus == 2 ? '已接受' :data[0].row.writingTestingStatus == -1 ? "放弃笔试":"暂无"}</div>

                        </>
                    )
                }
            }
        }
    },
    {
        field: 'writingTestingScore',
        label: '笔试成绩',
        fixed: "right",
        hidden: props.type == 2 ? false : true,
    },
    {
        field: 'writingTestingResult',
        label: '笔试结果',
        fixed: "right",
        hidden: props.type == 2 ? false : true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.writingTestingResult == 0 ? "未通过" : data[0].row.writingTestingResult == 1 ? "已通过" : "无结果"}</div>
                        </>
                    )
                }
            }
        }

    },
    {
        field: 'writingTestingTime',
        label: '笔试日期',
        fixed: "right",
        hidden: props.type == 2 ? false : true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.writingTestingTime ? data[0].row.writingTestingTime.slice(0, 11) : ""}</div>
                        </>
                    )
                }
            }
        }
    },
    // 面试成绩
    // {
    //     field: 'sms_typeName',
    //     label: '面试轮次',
    //     hidden: true,
    // },
    {
        field: 'interviewStatus',
        label: '面试通知',
        fixed: "right",
        hidden: true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.interviewStatus == 0 ? "未通知" : data[0].row.interviewStatus == 1 ? "已通知" : data[0].row.interviewStatus == 2 ? '已接受' : "暂无"}</div>
                        </>
                    )
                }
            }
        }

    },
    {
        field: 'interviewScore',
        label: '面试成绩',
        fixed: "right",
        hidden: props.type == 3 ? false : true,

    },
    {
        field: 'interviewResult',
        label: '面试结果',
        fixed: "right",
        hidden: true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.interviewResult == 0 ? "未通过" : data[0].row.interviewResult == 1 ? "已通过" : "无结果"}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'interviewDate',
        label: '面试日期',
        hidden: props.type == 3 ? false : true,
        fixed: "right",
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.interviewDate ? data[0].row.interviewDate.slice(0, 11) : ""}</div>
                        </>
                    )
                }
            }
        }
    },
    // 体检审查
    {
        field: 'tijian1',
        label: '审查状态',
        hidden: props.type == 4 ? false : true,
        fixed: "right",
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.status}</div>
                        </>
                    )
                }
            }
        }

    },
    {
        field: 'tijian2',
        label: '体检报告上传状态',
        hidden: props.type == 4 ? false : true,
        fixed: "right",
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.medicalReportIds ? "已上传" : "未上传"}</div>
                        </>
                    )
                }
            }
        }
    },
    //入职日期
    {
        field: 'onBoardingTime',
        label: '入职日期',
        fixed: "right",
        hidden: props.type == 5 ? false : true,
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.onBoardingTime ? data[0].row.onBoardingTime.slice(0, 11) : ""}</div>
                        </>
                    )
                }
            }
        }
    },
    {
        field: 'action',
        width: '160px',
        label: '操作',
        fixed: "right",
        search: {
            hidden: true
        },
        form: {
            hidden: true
        },
        detail: {
            hidden: true
        },
        table: {
            slots: {
                default: (data: any) => {
                    return (
                        <>
                            <ElButton link type="primary" onClick={() => goDetail(data[0].row)}>
                                查看详情
                            </ElButton>
                        </>
                    )
                }
            }
        }
    }
])
const { allSchemas } = useCrudSchemas(crudSchemas)
// -------------------------------------------------------------------应聘-发送简历
const ref_send = ref()
const sendClicks = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (ref_send.value) {
        ref_send.value.DialogOpen()
    }
}
const sendClick = (data) => {
    console.log("发送邮件参数", data);
    let arrays = [] as any
    let obj = {
        toMails: data.toMails,
        ids: [],
        fileType: "word"
    }
    state.arrayIds_s.forEach(element => {
        arrays.push(element.id)
    });
    obj.ids = arrays
    console.log("发送简历信息：", obj);
    sendResumeEmail(obj).then((res: any) => {
        ElMessage.success(res.msg)
        if (ref_send.value) {
            ref_send.value.DialogClose()
        }
        clearRefuse()
        emit("listVue", state.ruleFrom)
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
const dictFunString = (res) => {
    let string = ""
    if (res) {
        let arr = res.split(",")
        arr.forEach(element => {
            string = string + dictFuns(element, "resume_label") + " "
        });
    } else {
        string = "无"
    }
    return string

}
const qianClick = async () => {//------------------------------------------------------// 笔试签到表
    let arr = await arrayIds()
    console.log("多选数据", arr);
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    let string = ""
    state.arrayIds_s.forEach(element => {
        if (string) {
            string = string + "," + element.id
        } else {
            string = element.id
        }
    });
    zipFuns("/api/enterprise/positionRegistration/attendance?ids=" + string, 'excel')
}
const zipFuns = async (url: string, fileType: string) => {
    const userInfo = getStorage(appStore.getUserInfo)
    // ElLoading.service({ text: '正在下载数据，请稍候', background: 'rgba(0, 0, 0, 0.7)' });
    try {
        const res: any = await axios({
            method: 'get',
            url: url,
            responseType: 'blob',
            headers: {
                'Content-Type': defaultHeaders,
                "Authorization": `Bearer ${userInfo ? userInfo.access_token : ""}`,
                "clientid": userInfo ? userInfo.client_id : "d4dc82f7317e7c0482d95f764930e587"
            }
        });
        console.log(res);
        let blob = null as any
        if (fileType == "word" || fileType == "pdf") {
            blob = new Blob([res.data], { type: 'application/zip' })
        } else if (fileType == "excel") {
            blob = new Blob([res.data], { type: "application/vnd.ms-excel" })
        }
        const href = URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.download = '签到表'
        link.href = href
        link.click()
        URL.revokeObjectURL(href);
        document.body.removeChild(link);
        // ElLoading.service({text: '下载成功', background: 'rgba(0, 0, 0, 0.7)'}).close()
    } catch {

    }
}
//-----------------------------------邀请投递
watch(() => state.positionId, (newValue: any) => {
    state.ruleFrom.positionId = newValue
    isIndeterminate.value = false
    emit("listVue", state.ruleFrom)
})
const invite = (item) => {
    console.log(item);
    if (!state.positionId) {
        ElMessage.warning('请先选择投递职位!')
        return
    } else {
        ElMessageBox.confirm('确认投递该职位？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            // inputPattern:,
            draggable: true,
            type: 'warning',
        }).then(() => {
            let obj = {
                positionId: state.positionId,
                userId: item.personalInformation.userId
            }
            editResumeList(obj).then((res: any) => {
                ElMessage({
                    type: 'success',
                    message: `${res.msg}`,
                })
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage({
                    type: 'error',
                    message: `${res.msg}`,
                })
            })
        }).catch(() => {
            ElMessage({
                type: 'info',
                message: '取消操作',
            })
        })
    }
}
const down = async (fileType) => {//------------------------------------------批量下载简历
    let arr = await arrayIds()
    console.log("多选数据", arr);
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    let string = ""
    state.arrayIds_s.forEach(element => {
        if (string) {
            string = string + "," + element.id
        } else {
            string = element.id
        }
    });
    let objs = {
        ids: string,
        fileType: fileType
    }
    console.log("批量下载数据：", objs, state.arrayIds_s);
    zipFun(`/api/enterprise/positionRegistration/exportResume?ids=${objs.ids}&fileType=${objs.fileType}`, objs.fileType)
    // exportResume(objs).then((res: any) => {
    //     emit("listVue", state.ruleFrom)
    //     ElMessage.success(res.msg)
    //     clearRefuse()
    // }).catch((res: any) => {
    //     ElMessage.error(res.msg)
    // })
}
const zipFun = async (url: string, fileType: string) => {
    const userInfo = getStorage(appStore.getUserInfo)
    // ElLoading.service({ text: '正在下载数据，请稍候', background: 'rgba(0, 0, 0, 0.7)' });
    try {
        const res: any = await axios({
            method: 'get',
            url: url,
            responseType: 'blob',
            headers: {
                'Content-Type': defaultHeaders,
                "Authorization": `Bearer ${userInfo ? userInfo.access_token : ""}`,
                "clientid": userInfo ? userInfo.client_id : "d4dc82f7317e7c0482d95f764930e587"
            }
        });
        console.log(res);
        let blob = null as any
        if (fileType == "word" || fileType == "pdf") {
            blob = new Blob([res.data], { type: 'application/zip' })
        } else if (fileType == "excel") {
            blob = new Blob([res.data], { type: "application/vnd.ms-excel" })
        }
        const href = URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.download = '简历集'
        link.href = href
        link.click()
        URL.revokeObjectURL(href);
        document.body.removeChild(link);
        // ElLoading.service({text: '下载成功', background: 'rgba(0, 0, 0, 0.7)'}).close()
    } catch {

    }
}

const deteleTalentClick = async () => {// ---------------------------------人才库删除简历
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    ElMessageBox.confirm('确认删除简历？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        // inputPattern:,
        draggable: true,
        type: 'warning',
    }).then(() => {
        let arrays = [] as any
        state.arrayIds_s.forEach(element => {
            let obj = {
                id: element.id
            }
            arrays.push(obj)
        });
        console.log("人才库删除数据：", arrays);
        deleteResume(arrays).then((res: any) => {
            emit("listVue", state.ruleFrom)
            ElMessage.success(res.msg)
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    }).catch(() => {
        ElMessage({
            type: 'info',
            message: '取消操作',
        })
    })
    let arrays = [] as any
    state.arrayIds_s.forEach(element => {
        let obj = {
            positionRegistrationId: element.id,
        }
        arrays.push(obj)
    });
    console.log("人才库删除数据：", arrays);
}
const ref_refash = ref()
const refashClick = async () => {// ---------------------------------人才库重新进入初筛
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (ref_refash.value) {
        ref_refash.value.DialogOpen()
    }

}

const refashSureClick = (data) => {
    console.log(data);

    let arrays = [] as any
    state.arrayIds_s.forEach(element => {
        let obj = {
            positionId: data.positionRegistrationId,
            id: element.id
        }
        arrays.push(obj)
    });
    console.log("人才库重新进入初筛：", arrays);
    reFirstScreen(arrays).then((res: any) => {
        ElMessage.success(res.msg)
        if (ref_refash.value) {
            ref_refash.value.DialogClose()
        }
        clearRefuse()
        emit("listVue", state.ruleFrom)
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
const blickClick = async (item) => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    let arrays = [] as any
    state.arrayIds_s.forEach(element => {
        let obj = {
            blackList: item,
            id: element.id
        }
        arrays.push(obj)
    });
    console.log("人才库黑名单：", arrays);
    updateBackList(arrays).then((res: any) => {
        ElMessage.success(res.msg)
        clearRefuse()
        emit("listVue", state.ruleFrom)
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
// --------------------------------------------------------回退流程----------------------------------------------
const backClick = async (index) => {//------------------------------
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    let arrays = [] as any
    state.arrayIds_s.forEach(element => {
        let obj = {
            positionRegistrationId: element.id,
            status: index
        }
        arrays.push(obj)
    });
    ElMessageBox.confirm('确认将简历进行回退操作?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        // inputPattern:,
        draggable: true,
        type: 'warning',
    }).then(() => {
        registrationLogBack(arrays).then((res: any) => {
            ElMessage.success(res.msg)
            clearRefuse()
            emit("listVue", state.ruleFrom)
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    }).catch(() => {
        ElMessage({
            type: 'info',
            message: '取消操作',
        })
    })

}
// --------------------------------------------------------回退结束----------------------------------------------
// -------------------------------通过
const passClick = async () => {//------------------------------
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    let arrays = [] as any
    state.arrayIds_s.forEach(element => {
        let obj = {
            positionRegistrationId: element.id,
        }
        arrays.push(obj)
    });
    console.log("通过数据：", arrays);
    switch (props.type) {
        case 0://初筛通过
            firstPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 1://应聘部门通过
            departmentPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 2://笔试通过
            writtenExaminationPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 3://面试通过
            interviewPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 4://体检通过
            physicalExaminationPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;

        default:
            break;
    }

}
const passClickT = (item) => {//-------------------------------------体检审查通过
    let arrays = [] as any
    let obj = {
        positionRegistrationId: item.id,
    }
    arrays.push(obj)
    console.log("通过数据：", arrays);
    if (item.status == 5) {
        backgroundInvestigationPass(arrays).then((res: any) => {
            ElMessage.success(res.msg)
            clearRefuse()
            emit("listVue", state.ruleFrom)
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    } else if (item.status == 6) {
        physicalExaminationPass(arrays).then((res: any) => {
            ElMessage.success(res.msg)
            clearRefuse()
            emit("listVue", state.ruleFrom)
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    } else if (item.status == 7) {
        confirmEmployment(arrays).then((res: any) => {
            ElMessage.success(res.msg)
            clearRefuse()
            emit("listVue", state.ruleFrom)
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    }
}
// -----------------------------未通过

const ref_refuse = ref()
const refuseClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }

    state.refuseData.type = props.type
    if (ref_refuse.value) {
        ref_refuse.value.DialogOpen()
    }
}
const refuseClickT = (item) => {//---------------------------------------体检审查不通过
    state.refuseData.type = props.type
    state.tijianData = item
    if (ref_refuse.value) {
        ref_refuse.value.DialogOpen()
    }
}
const refuseSureClick = (data) => {//-----------------------------------
    console.log(data);
    let arrays = [] as any
    if (props.type != 4) {
        state.arrayIds_s.forEach(element => {
            let obj = {
                positionRegistrationId: element.id,
                content: data.content
            }
            arrays.push(obj)
        });
    } else {
        let obj = {
            positionRegistrationId: state.tijianData.id,
            remark: data.content
        }
        arrays.push(obj)
    }
    console.log("未通过数据：", arrays);
    // return
    switch (props.type) {
        case 0://初筛不通过
            firstNotPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 1://应聘部门不通过
            departmentNotPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 2://笔试不通过
            writtenExaminationNotPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 3://面试不通过
            interviewNotPass(arrays).then((res: any) => {
                ElMessage.success(res.msg)
                clearRefuse()
                emit("listVue", state.ruleFrom)
            }).catch((res: any) => {
                ElMessage.error(res.msg)
            })
            break;
        case 4://体检不通过
            if (state.tijianData.status == 5) {
                backgroundInvestigationNotPass(arrays).then((res: any) => {
                    ElMessage.success(res.msg)
                    clearRefuse()
                    emit("listVue", state.ruleFrom)
                }).catch((res: any) => {
                    ElMessage.error(res.msg)
                })
            } else if (state.tijianData.status == 6) {
                physicalExaminationNotPass(arrays).then((res: any) => {
                    ElMessage.success(res.msg)
                    clearRefuse()
                    emit("listVue", state.ruleFrom)
                }).catch((res: any) => {
                    ElMessage.error(res.msg)
                })
            } else if (state.tijianData.status == 7) {
                giveUpEmployment(arrays).then((res: any) => {
                    ElMessage.success(res.msg)
                    clearRefuse()
                    emit("listVue", state.ruleFrom)
                }).catch((res: any) => {
                    ElMessage.error(res.msg)
                })
            }

            break;

        default:
            break;
    }

}

function clearRefuse() {
    state.arrayIds_s = []
    checkAll.value = false
    if (ref_refuse.value) {
        ref_refuse.value.DialogClose()
    }
}
// -----------------------------------未通过告知
const ref_noPassVue = ref()// 
const noPassClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }

    state.onPassData.type = props.type
    if (ref_noPassVue.value) {
        ref_noPassVue.value.DialogOpen()
    }
}
const noPassSureClick = (data) => {
    let arrays = [] as any
    let arrays_updata = [] as any
    state.arrayIds_s.forEach(element => {
        arrays_updata.push({ id: element.id, writingTestingTime: formatDate(new Date()) })
        arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    });
    console.log("未通过通知数据：", arrays);
    sendNotice(arrays).then((res: any) => {
        ElMessage.success(res.msg)
            cleanNoPass()
            emit("listVue", state.ruleFrom)

    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
function cleanNoPass() {
    state.arrayIds_s = []
    checkAll.value = false
    if (ref_noPassVue.value) {
        ref_noPassVue.value.DialogClose()
    }
}
// -----------------------------------未通过告知结束
const ref_PenVue = ref()// -----------------------------笔试
const PenClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }

    state.penData.type = props.type
    if (ref_PenVue.value) {
        ref_PenVue.value.DialogOpen()
    }
}
function formatDate(date) {
    var year = date.getFullYear();

    var month = (1 + date.getMonth()).toString();
    month = month.padStart(2, '0');

    var day = date.getDate().toString();
    day = day.padStart(2, '0');

    var hours = date.getHours().toString();
    hours = hours.padStart(2, '0');

    var minutes = date.getMinutes().toString();
    minutes = minutes.padStart(2, '0');

    var seconds = date.getSeconds().toString();
    seconds = seconds.padStart(2, '0');

    return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
}
const penSureClick = (data) => {
    let arrays = [] as any
    let arrays_updata = [] as any
    state.arrayIds_s.forEach(element => {
        arrays_updata.push({ id: element.id, writingTestingTime: formatDate(new Date()) })
        arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    });
    console.log("笔试通知数据：", arrays);
    sendNotice(arrays).then((res: any) => {
        ElMessage.success(res.msg)
        clearPen()
        emit("listVue", state.ruleFrom)
        // positionRegistrations(arrays_updata).then((res: any) => {
        //     ElMessage.success(res.msg)
        //     clearPen()
        //     emit("listVue", state.ruleFrom)
        // })

    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
function clearPen() {
    state.arrayIds_s = []
    checkAll.value = false
    if (ref_PenVue.value) {
        ref_PenVue.value.DialogClose()
    }
}
// 导入笔试---------------------------------------------
const ref_PenFile = ref()
const ref_PenFailVue = ref()
const PenFileClick = async () => {
    // let arr = await arrayIds()
    // if (arr.length == 0) {
    //     return
    // } else {
    //     state.arrayIds_s = arr
    // }

    // state.penData.type = props.type
    if (ref_PenFile.value) {
        ref_PenFile.value.DialogOpen()
    }
}
const penFileSureClick = (data) => {
    let obj = {
        param: { file: data.file },
        passingGrade: data.passingGrade,
        recruitmentPositionId: data.recruitmentPositionId,
    }
    console.log("笔试上传数据：", obj);
    importWrittenExaminationScore(obj).then((res: any) => {
        // ElMessage.success(res.msg)
        clearPenFile()
        state.penFailData = res.data
        if (ref_PenFailVue.value) {
            ref_PenFailVue.value.DialogOpen()
        }
        emit("listVue", state.ruleFrom)
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
// 导入面试----------------------------------------------
const ref_FaceFile = ref()
const ref_FaceFailVue = ref()
const FaceFileClick = async () => {
    // let arr = await arrayIds()
    // if (arr.length == 0) {
    //     return
    // } else {
    //     state.arrayIds_s = arr
    // }

    // state.penData.type = props.type
    if (ref_FaceFile.value) {
        ref_FaceFile.value.DialogOpen()
    }
}
const FaceFileSureClick = (data) => {
    let obj = {
        param: { file: data.file },
        passingGrade: data.passingGrade,
        recruitmentPositionId: data.recruitmentPositionId,
    }
    console.log("面试上传数据：", obj);
    importInterviewExaminationScore(obj).then((res: any) => {
        // ElMessage.success(res.msg)
        clearFaceFile()
        state.penFailData = res.data
        if (ref_PenFailVue.value) {
            ref_PenFailVue.value.DialogOpen()
        }
        emit("listVue", state.ruleFrom)
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
function clearPenFile() {
    state.arrayIds_s = []
    checkAll.value = false
    if (ref_PenFile.value) {
        ref_PenFile.value.DialogClose()
    }
}
function clearFaceFile() {
    state.arrayIds_s = []
    checkAll.value = false
    if (ref_FaceFile.value) {
        ref_FaceFile.value.DialogClose()
    }
}
// ----------------------------面试
const ref_face = ref()
const faceClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (ref_face.value) {
        ref_face.value.DialogOpen()
    }
}
const faceSureClick = (data) => {
    let arrays = [] as any
    let arrays_updata = [] as any
    state.arrayIds_s.forEach(element => {
        arrays_updata.push({ id: element.id, interviewDate: formatDate(new Date()) })
        arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    });
    console.log("邀约面试通知数据：", arrays);
    sendNotice(arrays).then((res: any) => {
        ElMessage.success(res.msg)
        clearPenFile()
        state.penFailData = res.data
        state.arrayIds_s = []
        emit("listVue", state.ruleFrom)
        // positionRegistrations(arrays_updata).then((res: any) => {
        //     ElMessage.success(res.msg)
        //     clearPenFile()
        //     state.penFailData = res.data
        //     state.arrayIds_s = []
        //     emit("listVue", state.ruleFrom)
        // })

        if (ref_face.value) {
            ref_face.value.DialogClose()
        }
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })

}
// ----------------------------反馈
const ref_Feedback = ref()
const FeedbackClick = async (index) => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (index == 0) {
        state.FeedbackData.title = "添加反馈"
    } else if (index == 1) {
        state.FeedbackData.title = "放弃入职"
    }
    if (ref_Feedback.value) {
        ref_Feedback.value.DialogOpen()
    }
}
const FeedbackSureClick = (value) => {
    console.log("放弃入职：", value);
    if (state.FeedbackData.title == "添加反馈") {
        let arrays = [] as any
        state.arrayIds_s.forEach(element => {
            arrays.push({ positionRegistrationId: element.id })
        });
        let obj = {
            param: arrays,
            notice: value,
        }
        console.log("添加反馈数据：", obj);
        addFeedback(obj).then((res: any) => {
            ElMessage.success(res.msg)
            clearFeedback()
            state.penFailData = res.data
            state.arrayIds_s = []
            emit("listVue", state.ruleFrom)
            if (ref_face.value) {
                ref_face.value.DialogClose()
            }
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    } else {
        let arrays = [] as any
        state.arrayIds_s.forEach(element => {
            arrays.push({ positionRegistrationId: element.id })
        });
        let obj = {
            param: arrays,
            notice: value,
        }
        console.log("放弃入职数据：", obj);
        giveUpEntry(obj).then((res: any) => {
            ElMessage.success(res.msg)
            clearFeedback()
            state.penFailData = res.data
            state.arrayIds_s = []
            emit("listVue", state.ruleFrom)
            if (ref_face.value) {
                ref_face.value.DialogClose()
            }
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    }

}
function clearFeedback() {
    if (ref_Feedback.value) {
        ref_Feedback.value.DialogClose()
    }
}
// ----------------------------体检通知
const ref_Checkup = ref()
const CheckupClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (ref_Checkup.value) {
        ref_Checkup.value.DialogOpen()
    }
}
const CheckupSureClick = (data) => {
    // let arrays = [] as any
    // state.arrayIds_s.forEach(element => {
    //     arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    // });
    // console.log("体检通知数据：", arrays);
    // sendNotice(arrays).then((res: any) => {
    //     ElMessage.success(res.msg)
    //     clearPenFile()
    //     state.penFailData = res.data
    //     state.arrayIds_s = []
    //     emit("listVue", state.ruleFrom)
    //     if (ref_Checkup.value) {
    //         ref_Checkup.value.DialogClose()
    //     }
    // }).catch((res: any) => {
    //     ElMessage.error(res.msg)
    // })
    let arrays = [] as any
    let arrays_updata = [] as any
    state.arrayIds_s.forEach(element => {
        // arrays_updata.push({ id: element.id, interviewDate: formatDate(new Date()) })
        arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    });
    console.log("体检通知数据：", arrays);
    sendNotice(arrays).then((res: any) => {
        ElMessage.success(res.msg)
            clearPenFile()
            state.penFailData = res.data
            state.arrayIds_s = []
            emit("listVue", state.ruleFrom)
            if (ref_Checkup.value) {
                ref_Checkup.value.DialogClose()
            }
        // positionRegistrations(arrays_updata).then((res: any) => {
           
        // })
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
// ----------------------------公示短信
const ref_Gs = ref()
const GsClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (ref_Gs.value) {
        ref_Gs.value.DialogOpen()
    }
}
const GsSureClick = (data) => {
    // let arrays = [] as any
    // state.arrayIds_s.forEach(element => {
    //     arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    // });
    // console.log("体检通知数据：", arrays);
    // sendNotice(arrays).then((res: any) => {
    //     ElMessage.success(res.msg)
    //     clearPenFile()
    //     state.penFailData = res.data
    //     state.arrayIds_s = []
    //     emit("listVue", state.ruleFrom)
    //     if (ref_Checkup.value) {
    //         ref_Checkup.value.DialogClose()
    //     }
    // }).catch((res: any) => {
    //     ElMessage.error(res.msg)
    // })
    let arrays = [] as any
    let arrays_updata = [] as any
    state.arrayIds_s.forEach(element => {
        arrays_updata.push({ id: element.id, interviewDate: formatDate(new Date()) })
        arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
    });
    console.log("公示通知数据：", arrays);
    sendNotice(arrays).then((res: any) => {
        positionRegistrations(arrays_updata).then((res: any) => {
            ElMessage.success(res.msg)
            clearPenFile()
            state.penFailData = res.data
            state.arrayIds_s = []
            emit("listVue", state.ruleFrom)
            if (ref_Gs.value) {
                ref_Gs.value.DialogClose()
            }
        })
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })
}
// ----------------------------公示短信结束
// ----------------------------录用通知
const ref_Employment = ref()
const EmploymentClick = async (index) => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    if (index == 0) {
        state.EmploymentData.title = "录用通知"
    } else if (index == 1) {
        state.EmploymentData.title = "发送入职通知"
    }
    if (ref_Employment.value) {
        ref_Employment.value.DialogOpen()
    }
}
const EmploymentSureClick = (data) => {
    if (state.EmploymentData.title == "录用通知") {
        let arrays = [] as any
        state.arrayIds_s.forEach(element => {
            arrays.push({ positionRegistrationId: element.id })
        });
        let obj = {
            param: arrays,
            time: data.time,
            location: data.location,
            notice: data.notice,
            interviewRound: data.interviewRound
        }
        console.log("录用通知数据：", obj);
        sendEmploymentNotice(obj).then((res: any) => {
            ElMessage.success(res.msg)
            clearPenFile()
            clearRefuse()
            state.penFailData = res.data
            emit("listVue", state.ruleFrom)
            if (ref_Employment.value) {
                ref_Employment.value.DialogClose()
            }
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    } else if (state.EmploymentData.title == "发送入职通知") {
        let arrays = [] as any
        let arrays_updata = [] as any
        state.arrayIds_s.forEach(element => {
            arrays_updata.push({ id: element.id, interviewDate: formatDate(new Date()) })
            arrays.push({ positionRegistrationId: element.id, logName: data.logName, content: data.content, param: data.param, templateId: data.templateId })
        });
        console.log("发送入职通知通知数据：", arrays);
        sendNotice(arrays).then((res: any) => {
            ElMessage.success(res.msg)
            clearPenFile()
            state.penFailData = res.data
            state.arrayIds_s = []
            emit("listVue", state.ruleFrom)
            // positionRegistrations(arrays_updata).then((res: any) => {
            //     ElMessage.success(res.msg)
            //     clearPenFile()
            //     state.penFailData = res.data
            //     state.arrayIds_s = []
            //     emit("listVue", state.ruleFrom)
            // })
        }).catch((res: any) => {
            ElMessage.error(res.msg)
        })
    }
    if (ref_Employment.value) {
        ref_Employment.value.DialogClose()
    }
}
// ----------------------------录用公示
const ref_Publicity = ref()
const PublicityClick = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
        state.PublicityData.arraysIds = state.arrayIds_s
        state.PublicityData.number = state.arrayIds_s.length
    }
    if (ref_Publicity.value) {
        ref_Publicity.value.DialogOpen()
    }
}
const PublicitySureClick = (data) => {
    let obj = {
        announcementTitle: data.announcementTitle,
        announcementContents: data.announcementContents,
        remark: JSON.stringify(data.arrayIds),
    }
    console.log("公示通知数据：", obj);
    companyAnnouncement(obj).then((res: any) => {
        ElMessage.success(res.msg)
        emit("listVue", state.ruleFrom)
        if (ref_Publicity.value) {
            ref_Publicity.value.DialogClose()
        }
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })

}
// ----------------------------------确认入职
const formChildrenRefs = ref()
const ruzhi = async () => {
    let arr = await arrayIds()
    if (arr.length == 0) {
        return
    } else {
        state.arrayIds_s = arr
    }
    let arrays = [] as any
    state.arrayIds_s.forEach(element => {
        arrays.push({ positionRegistrationId: element.id })
    });
    // let obj = {
    //     param: arrays,
    // }
    console.log("确认入职数据：", arrays);
    confirmEntry(arrays).then((res: any) => {
        ElMessage.success(res.msg)
        state.arrayIds_s = []
        emit("listVue", state.ruleFrom)
        if (formChildrenRefs.value) {
            formChildrenRefs.value.DialogOpen()
        }
    }).catch((res: any) => {
        ElMessage.error(res.msg)
    })

}
const deteleClick = (value) => {
    if (value) {
        console.log("确定删除！");
        if (formChildrenRefs.value) {
            formChildrenRefs.value.DialogClose()
        }
    }
}
// -----------------------------------------
const goDetail = (item) => {
    if (props.type == 6) {
        push(`/Detail/Detail-index?type=${props.type}&id=${item.personalInformation.userId}`)
    } else {
        push(`/Detail/Detail-index?id=${item.id}`)
    }
}
const navClick = (item) => {//
    state.navValue = item.id
}
function startWorkTimeFun(res) {
    if (res) {
        let number = 0
        let date = new Date()
        let year = date.getFullYear();
        number = year - res.split("-")[0]
        if (number <= 0) {
            return ""
        } else {
            return number + "年工作经验"
        }

    } else {
        return ""
    }
}
function arrayFun(res) {
    let array = []
    let arrays = [] as any
    if (res) {
        array = res.split(",")
    }
    array.forEach(element => {
        arrays.push(dictFuns(element, "resume_label"))
    })
    return arrays
}
const arrayIds = async () => {
    let array = [] as any
    // console.log(array);
    if (props.type != 6) {
        const elTableRef = await getElTableExpose()
        const selections = elTableRef?.getSelectionRows()
        console.log("多选框", selections);
        if (selections == null || selections.length == 0) {
            ElMessage.warning("至少选择一份简历！")
        } else {
            selections.forEach(element => {
                array.push(element)
            });
            // array = selections

        }
    } else {
        state.list.forEach(element => {
            if (element.checked) {
                array.push(element)
            }
        });
        if (array.length == 0) {
            ElMessage.warning("至少选择一份简历！")
            return []
        } else {
            return array
        }
    }
    return array

}
const checkAll = ref(false)
const isIndeterminate = ref(false)
const handleCheckAllChange = (val: boolean) => {
    if (val) {
        state.list.forEach(element => {
            element.checked = true
        })
    } else {
        state.list.forEach(element => {
            element.checked = false
        })
    }
    isIndeterminate.value = false
}
const handleSizeChange = (val: number) => {//分页
    console.log(`${val} items per page`)
    state.ruleFrom.pageSize = val
    emit("listVue", state.ruleFrom)
}
const handleCurrentChange = (val: number) => {//分页大小
    console.log(`current page: ${val}`)
    state.ruleFrom.pageNum = val
    emit("listVue", state.ruleFrom)
}
const positionListAllApi = async () => {
    await positionListAll().then(res => {
        console.log("全部职位", res);
        state.positionOptions = res.data
    })
}
positionListAllApi()
function refushclick(value) {
    setTimeout(() => {
        state.crudSchemas = [
            {
                field: 'selection',
                type: 'selection'
            },
            {
                field: 'field',
                label: '姓名',
                fixed: "left",
                hidden: false,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.resumeVo?.personalInformation?.fullName}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'status',
                label: '简历标签',
                // hidden: true,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFunString(data[0].row.initialScreeningUnqualifiedLabel)}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'field',
                label: '性别',
                hidden: true,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFuns(data[0].row.resumeVo.personalInformation?.gender, "sys_user_sex") || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'field',
                label: '年龄',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.resumeVo?.personalInformation?.age}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'field',
                label: '工作年限',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{startWorkTimeFun(data[0].row.resumeVo?.personalInformation?.startWorkTime) || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'field',
                label: '期望薪资',
                // hidden: true,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFuns(data[0].row.resumeVo.personalInformation?.lookingForwardSalary, "salary") || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '最高学历',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFuns(data[0].row.resumeVo.educationExperiences[data[0].row.resumeVo.educationExperiences.length -
                                        1].educationLevel, "education") || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '学校',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.resumeVo.educationExperiences[data[0].row.resumeVo.educationExperiences.length -
                                        1].schoolName || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '所学专业',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.resumeVo.educationExperiences[data[0].row.resumeVo.educationExperiences.length - 1].specialFieldName || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '目前职位',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.resumeVo.personalInformation?.currentPosition || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '在职状态',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFuns(data[0].row.resumeVo.personalInformation?.jobSearchStatus, "status_of_job_hunting") || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '到岗时间',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFuns(data[0].row.resumeVo.personalInformation?.arrivalTime, "arrival_time") || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'sms_typeName',
                label: '政治面貌',
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{dictFuns(data[0].row.resumeVo.personalInformation?.politicalOutlook, "political_outlook") || "无"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            // 笔试成绩
            {
                field: 'writingTestingStatus',
                label: '笔试通知',
                fixed: "right",
                hidden: true,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.writingTestingStatus == 0 ? "未通知" : data[0].row.writingTestingResult == 1 ? "已通知" : data[0].row.writingTestingStatus == 2 ? '已接受' : "暂无"}</div>

                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'writingTestingScore',
                label: '笔试成绩',
                fixed: "right",
                hidden: props.type == 2 ? false : true,
            },
            {
                field: 'sms_typeName',
                label: '笔试结果',
                fixed: "right",
                hidden: props.type == 2 ? false : true,
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.writingTestingResult == 0 ? "未通过" : data[0].row.writingTestingResult == 1 ? "已通过" : "无结果"}</div>
                        </>
                    )
                }
            },
            {
                field: 'writingTestingTime',
                label: '笔试日期',
                fixed: "right",
                hidden: props.type == 2 ? false : true,
            },
            // 面试成绩
            // {
            //     field: 'sms_typeName',
            //     label: '面试轮次',
            //     hidden: true,
            // },
            {
                field: 'interviewStatus',
                label: '面试通知',
                fixed: "right",
                hidden: true,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.interviewStatus == 0 ? "未通知" : data[0].row.interviewStatus == 1 ? "已通知" : data[0].row.interviewStatus == null ? '' : "已接受"}</div>
                                </>
                            )
                        }
                    }
                }

            },
            {
                field: 'interviewScore',
                label: '面试成绩',
                fixed: "right",
                hidden: props.type == 3 ? false : true,

            },
            {
                field: 'interviewResult',
                label: '面试结果',
                fixed: "right",
                hidden: true,
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <div>{data[0].row.interviewResult == 0 ? "未通过" : data[0].row.interviewResult == 1 ? "已通过" : "无结果"}</div>
                                </>
                            )
                        }
                    }
                }
            },
            {
                field: 'interviewDate',
                label: '面试日期',
                hidden: props.type == 3 ? false : true,
                fixed: "right",
            },

            // 体检审查
            {
                field: 'status',
                label: '审查状态',
                hidden: props.type == 4 ? false : true,
                fixed: "right",
            },
            {
                field: 'sms_typeName',
                label: '体检报告上传状态',
                fixed: "right",
                hidden: props.type == 4 ? false : true,
                default: (data: any) => {
                    return (
                        <>
                            <div>{data[0].row.medicalReportIds ? "已上传" : "未上传"}</div>
                        </>
                    )
                }
            },
            //入职日期
            {
                field: 'onBoardingTime',
                label: '入职日期',
                fixed: "right",
                hidden: props.type == 5 ? false : true,
            },
            {
                field: 'action',
                width: '160px',
                label: '操作',
                fixed: "right",
                search: {
                    hidden: true
                },
                form: {
                    hidden: true
                },
                detail: {
                    hidden: true
                },
                table: {
                    slots: {
                        default: (data: any) => {
                            return (
                                <>
                                    <ElButton link type="primary" onClick={() => goDetail(data[0].row)}>
                                        查看详情
                                    </ElButton>
                                </>
                            )
                        }
                    }
                }
            }
        ]
        state.refush = !state.refush
        state.dataList = value
        state.dataList.forEach(element => {
            element.status = statusFun(element)
        });
    }, 100);

}
const tableBool = ref(null)
watch(() => props.data, (newValue: any) => {
    console.log("数据监听watch", props.type);
    state.types = props.type
    // refushclick(newValue)
    tableColumnFun()

    // let { allSchemas } = useCrudSchemas(crudSchemas)
    state.dataList = newValue
    state.dataList.forEach(element => {
        element.status = statusFun(element)
    });
    state.list = newValue
    state.list.forEach(element => {
        element.checked = false
    })
    checkAll.value = false
    state.ruleFrom = props.ruleFrom
})
function tableColumnFun() {
    setColumn([
        {
            field: 'writingTestingStatus',
            path: 'hidden',
            value: props.type == 2 ? false : true
        }
    ])
    setColumn([
        {
            field: 'writingTestingScore',
            path: 'hidden',
            value: props.type == 2 ? false : true
        }
    ])
    setColumn([
        {
            field: 'writingTestingResult',
            path: 'hidden',
            value: props.type == 2 ? false : true
        }
    ])
    setColumn([
        {
            field: 'writingTestingTime',
            path: 'hidden',
            value: props.type == 2 ? false : true
        }
    ])
    // 面试
    // 
    setColumn([
        {
            field: 'interviewStatus',
            path: 'hidden',
            value: props.type == 3 ? false : true
        }
    ])
    setColumn([
        {
            field: 'interviewResult',
            path: 'hidden',
            value: props.type == 3 ? false : true
        }
    ])
    setColumn([
        {
            field: 'interviewDate',
            path: 'hidden',
            value: props.type == 3 ? false : true
        }
    ])
    setColumn([
        {
            field: 'interviewScore',
            path: 'hidden',
            value: props.type == 3 ? false : true
        }
    ])
    // 体检
    setColumn([
        {
            field: 'tijian1',
            path: 'hidden',
            value: props.type == 4 ? false : true
        }
    ])
    setColumn([
        {
            field: 'tijian2',
            path: 'hidden',
            value: props.type == 4 ? false : true
        }
    ])
    // ruzhi
    setColumn([
        {
            field: 'onBoardingTime',
            path: 'hidden',
            value: props.type == 5 ? false : true
        }
    ])
}
</script>

<style lang="less" scoped>
.colors {
    color: #52525A;
}

.list_content_btn {
    .el-button {
        height: 40px;
    }
}

.list_content_header {
    width: 90px;
    height: 40px;
    opacity: 1;
    border: 1px solid #C0C4CC;

    &:nth-child(1) {
        border-radius: 4px 0px 0px 4px;
    }

    &:nth-child(2) {
        border-radius: 0px 4px 4px 0px;
    }
}

.list_content_headers {
    background: #2F6CBC;

    opacity: 1;
    border: 1px solid #2F6CBC;
    color: #FFFFFF;
}

.List_content {
    // position: relative;

    .List_content_footer {
        width: calc(100% - 24px);
        position: absolute;
        bottom: 16px;
    }
}

.list_content_ul {
    padding: 0;

    .list_content_li {
        position: relative;
        // list-style: none;
        list-style: none;
        width: calc(100% - 73px);
        padding: 25px 48px 25px 25px;
        margin-bottom: 10px;
        // height: 154px;
        background: #FFFFFF;
        opacity: 1;
        border: 1px solid #D8D8D8;

        &:hover {
            border: 1px solid #2F6CBC;

        }

        .list_content_li_main {
            margin-left: 30px;
        }

        // .list_content_li_left{
        //     width: calc(100% - 300px);
        // }
        // .list_content_li_right{
        //     width: 200px;
        // }
        .list_content_li_state {
            position: absolute;
            right: 0;
            top: 0;
            width: 48px;
            height: 24px;
            background: #2F6CBC;
            border-radius: 0px 0px 0px 8px;
            opacity: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #FFFFFF;
        }

        .list_content_li_states {
            position: absolute;
            right: 0;
            top: 0;
            width: 62px;
            height: 24px;
            background: #FE6470;
            border-radius: 0px 0px 0px 8px;
            opacity: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #FFFFFF;
        }

        .list_content_li_gary {
            background: #C0C4CC;
        }
    }
}
</style>